import {request} from "./index"
/** 商品列表
 * 
 * @param {number} page
 * @param {number} size
 * @param {string} goodsName 
 * @param {string} recommend 
 */
const getGoods = (page, size, goodsName,recommend, token) => {
  return request.get("v2/app/goods/list", {
    page,
    size,
    goodsName,
    marketEnable: 'UPPER',
    recommend
  },{
    'Authorization': token
  })
}
/** 商品详情
 * 
 * @param {string} id
  */
const getGoodsDetail = (id, token) => {
  return request.get(`v2/app/goods/get/${id}`,{},{
    'Authorization': token
  })
}

/** 新商品详情
 * 
 * @param {string} id
  */
 const newGetGoodsDetail = (goodsId, skuId, token) => {
  return request.get(`v2/app/goods/sku/${goodsId}/${skuId}`,{},{
    'Authorization': token
  })
}
/** 商品规格
 * 
 * @param {string} goodsId
 * @param {string} skuId
  */
const getGoodsSku = (goodsId, skuId) => {
  return request.get("v2/app/goods/get", {
    goodsId,
    skuId
  })
}
export {
  getGoods,
  getGoodsDetail,
  getGoodsSku,
  newGetGoodsDetail
}
